<?php
header("Content-type:text/html;charset=utf-8");
function json($code,$message="",$data=array()){  
            $result=array(  
              'code'=>$code,  
              'message'=>$message,  
              'data'=>$data   
            );  
            //输出json  
            echo json_encode($result,JSON_UNESCAPED_UNICODE);  
            exit;  
}  
// $id = $_POST["id"];
$conn=mysql_connect("localhost","root","root");
if($conn){
	mysql_select_db("2010");
	// echo 123;
}
$result = mysql_query("select * from xixi where Id",$conn);

if(mysql_num_rows($result)>0){
	$dataarr = array();
	while($row = mysql_fetch_assoc($result)) {
		$dataarr[]=$row;  
	}  
	echo json(1,'查询成功',$dataarr);
}


mysql_close($conn);
?>
